<template>
	<view v-if="orderInfo" class="content">
		<view class="wid100 bacFFF">
			<view class="wid90 mar dis disAl disJuC" style="height: 100rpx;">
				<view class="dis fowe600 foSi25">
					<view class="textCen">
						<view class="dis disAl disJuC borRad50 coFFF mar"
							:style="orderInfo.status >= 0 && orderInfo.status!=8?'background: #37BCC3;':'background: #A6A6A6;'"
							style="width: 35rpx;height: 35rpx;line-height: 38rpx;">1</view>
						<view class="mar-top10" style="color: #666565;">已下单</view>
					</view>
					<view style="width: 83rpx;height: 1rpx;background: #A6A6A6;margin-left: -6rpx;margin-top: 16rpx;">
					</view>
					<view class="textCen" style="margin-left: -6rpx;">
						<view class="dis disAl disJuC borRad50 coFFF mar"
							:style="orderInfo.status >= 5 && orderInfo.status!=8?'background: #37BCC3;':'background: #A6A6A6;'"
							style="width: 35rpx;height: 35rpx;line-height: 38rpx;">2</view>
						<view class="mar-top10" style="color: #666565;">待发货</view>
					</view>
					<view style="width: 83rpx;height: 1rpx;background: #A6A6A6;margin-left: -6rpx;margin-top: 16rpx;">
					</view>
					<view class="textCen" style="margin-left: -6rpx;">
						<view class="dis disAl disJuC borRad50 coFFF mar"
							:style="orderInfo.status >= 6 && orderInfo.status!=8?'background: #37BCC3;':'background: #A6A6A6;'"
							style="width: 35rpx;height: 35rpx;line-height: 38rpx;">3</view>
						<view class="mar-top10" style="color: #666565;">待收货</view>
					</view>
					<view style="width: 83rpx;height: 1rpx;background: #A6A6A6;margin-left: -6rpx;margin-top: 16rpx;">
					</view>
					<view class="textCen" style="margin-left: -6rpx;">
						<view class="dis disAl disJuC borRad50 coFFF mar"
							:style="orderInfo.status >= 7 && orderInfo.status!=8?'background: #37BCC3;':'background: #A6A6A6;'"
							style="width: 35rpx;height: 35rpx;line-height: 38rpx;">4</view>
						<view class="mar-top10" style="color: #666565;">已完成</view>
					</view>
				</view>
			</view>
		</view>
		<view class="wid90 mar bacFFF mar-top30 borRad20" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);">
			<view class="wid90 mar dis disAl fowe800 foSi30" style="height: 74rpx;">收货信息</view>
			<view class="wid100 xia"></view>
			<view class="wid90 mar" style="padding: 25rpx 0;">
				<view class="dis disAl ">
					<view>{{orderInfo.address_give.name}}</view>
					<view class="mar-left30">{{orderInfo.address_give.phone}}</view>
				</view>
				<view class="mar-top20" style="color: #8B8B8B;">
					{{orderInfo.address_give.address+orderInfo.address_give.content}}</view>
			</view>
		</view>
		<view class="wid90 mar bacFFF mar-top30 borRad20" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);" v-if="orderInfo.status > 5 && orderInfo.status!=8">
			<view class="wid90 mar dis disAl fowe800 foSi30" style="height: 74rpx;">物流信息</view>
			<view class="wid100 xia"></view>
			<view class="wid90 mar" style="padding: 25rpx 0;">
				<view class="foSi25">
					<view>物流公司：{{orderInfo.company}}</view>
					<view class="">物流单号：{{orderInfo.logistics}}</view>
				</view>
			</view>
		</view>
		<view class="wid90 mar bacFFF mar-top30 borRad20" style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);">
			<view class="wid90 mar dis disAl" style="height: 96rpx;">
				<image src="../../static/shangjia_icon.png" style="width: 39rpx;height: 35rpx;"></image>
				<view class="fowe800 foSi35 mar-left20">{{orderInfo.gasstation.name}}</view>
			</view>
			<view class="wid100 xia"></view>
			<block v-for="(item, index) in JSON.parse(orderInfo.goods_info)" :key="index">
				<view class="wid90 mar dis disAl " style="padding: 25rpx 0;">
					<view class="wid25" style="height: 115rpx;">
						<image :src="url+item.goods_pic" class="hei100" style="width: 115rpx;"></image>
					</view>
					<view style="width: 75%;">
						<view class="foSi25 fowe600 yclh">{{item.goods_name}}</view>
						<view class="mar-top30 dis disAl disJuB foSi25">
							<view style="color: #A8AAAA;">×{{item.nums}}</view>
							<view class="fowe600" style="color: #37BCC3;">¥{{item.money}}</view>
						</view>
					</view>
				</view>
				<view class="wid100 xia"></view>
			</block>
			<view class="wid90 mar mar-top30 foSi25 fowe600">
				<view>订单金额： ¥{{orderInfo.total_amount}}</view>
				<view class="mar-top20">运费： ¥{{orderInfo.freight}}</view>
				<view class="mar-top20">优惠券抵扣： ¥{{orderInfo.coupon_money}}</view>
				<view class="mar-top20">实际支付：<span style="color: #37BCC3;">¥{{orderInfo.pay_amount}}</span></view>
				<view class="dis disAl mar-top20">
					<view class="mar-right20">订单编号： {{orderInfo.ordernum}}</view>
					<image src="../../static/fuzhi1.png" @click="fuzhi(orderInfo.ordernum)"
						style="width: 24rpx;height: 26rpx;"></image>
				</view>
				<view class="mar-top20">提交时间：{{orderInfo.createtime}}</view>
				<view class="mar-top20">支付方式：微信支付</view>
				<view class="mar-top20">备注：{{orderInfo.remarks?orderInfo.remarks:'无'}}</view>
				<view class="hei20"></view>
			</view>
		</view>
		<view style="height: 50rpx;"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: this.global.url,
				id: 0,
				orderInfo: ''
			}
		},
		onLoad(option) {
			this.id = option.id
			this.getList()
		},
		onShow() {},
		methods: {
			fuzhi(value) {
				//提示模板
				uni.showModal({
					content: value, //模板中提示的内容
					confirmText: '复制内容',
					success: () => { //点击复制内容的后调函数
						//uni.setClipboardData方法就是讲内容复制到粘贴板
						uni.setClipboardData({
							data: value, //要被复制的内容
							success: () => { //复制成功的回调函数
								uni.showToast({ //提示
									title: '复制成功'
								})
							}
						});
					},
				});
			},
			getList() {
				var that = this;
				uni.request({
					url: that.global.url + '/api/qianyu_petrol/gasstation_pay_order_info',
					method: "POST",
					header: {
						'site-id': that.global.site_id, //自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {
						id: that.id,
					},
					success(res) {
						let result = res.data
						console.log(result)
						if (result.code == 1) {
							that.orderInfo = result.data
						}
					}
				})
			},
		}
	}
</script>

<style>
	.content {
		background: #F3F1F1;
		min-height: 100vh;
	}

	.xia {
		height: 1rpx;
		border-bottom: 1rpx dashed #E1DFDF;
	}
</style>